//
//  ExprTests.m
//  ExprTests
//
//  Created by 赵梁 on 2018/9/17.
//  Copyright © 2018年 layzhao. All rights reserved.
//

#import <XCTest/XCTest.h>
#import "ZZExprMgr.h"

@interface ExprTests : XCTestCase

@end

@implementation ExprTests

- (void)setUp {
    [super setUp];
    // Put setup code here. This method is called before the invocation of each test method in the class.
}

- (void)tearDown {
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    [super tearDown];
}

- (void)testExample {
    // This is an example of a functional test case.
    // Use XCTAssert and related functions to verify your tests produce the correct results.
    [ZZExprMgr sharedManager].userId = @"1001ß";
//    NSMutableDictionary *all = [[ZZExprMgr sharedManager] getAllExpt];
//    [all setValue:@{@"value":@(NO)} forKey:@"useNewLogin"];
//    [[ZZExprMgr sharedManager] saveDicCacheExprConfigItems];
    
    BOOL value = [[ZZExprMgr sharedManager] getExptWithFeatureCode:@"useNewLogin" withValueKey:@"value" withBoolDefault:YES];
    NSLog(@"%@", @(value));
    
    NSString *valueString = [[ZZExprMgr sharedManager] getExptWithFeatureCode:@"useNewLogin" withValueKey:@"value" withStringDefault:@"abc"];
    NSLog(@"%@", valueString);
}

- (void)testExample2 {
    
    NSRecursiveLock *lock = [NSRecursiveLock new];
    
    [lock lock];
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),^{
        [lock lock];
        NSLog(@"3");
        [lock unlock];
    });
    
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),^{
        NSLog(@"2");
        [lock unlock];
    });
}

- (void)testPerformanceExample {
    // This is an example of a performance test case.
    [self measureBlock:^{
        // Put the code you want to measure the time of here.
    }];
}

@end
